package com.springapp.repository;

import java.util.List;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

import com.springapp.model.ItemInOrder;
import com.springapp.model.Order;

public interface ItemInOrderRepository extends CrudRepository<ItemInOrder, Integer>{
	
	@Modifying
	@Transactional
	@Query(value = "DELETE FROM ORDER_ITEM WHERE ORDER_ID = ?1", nativeQuery = true)
	void deleteItemInOrderByOrderId(Integer orderId);
	
}
